import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LXW
 * Date: 2022-04-07
 * Time: 16:27
 */
public class Demo {
    public static void main(String[] args) {
         class MyThread extends Thread {
            @Override
            public void run() {
                while(true) {
                    System.out.println(Thread.currentThread().getName());
                    Random random = new Random();
                    try {
                        Thread.sleep(random.nextInt(10));
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        Thread t1 = new MyThread();
         t1.start();
    }
}
